<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://www.extremecomponents.org" prefix="ec"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="includeCSSjs.jsp" />
	
	<script type="text/javascript">
	
	$(document).ready(function() {
    $("#tbCatMateriaTempDet").validate();
});
	
	function onTableClick(	
			idMateria,
			nombreMateria,
			idCatMateriaTempDet) {
		
		$("#idCatMateriaTempDet").val(idCatMateriaTempDet);
		getMateria(idMateria,nombreMateria);
	showEdit();
	}
	
	function showEdit() {
				$(".editbutton_div").hide("fast");
				$(".button_div").hide("slow");
				$(".editbutton_div").show("slow");

			}

			function hiddenEdit() {
				$(".editbutton_div").hide("fast");
				$(".button_div").show("slow");
			}
			

	function getMateria(idMateria,nombreMateria){
				$("#idMateria").val(idMateria);
				$("#nombreMateria").val(nombreMateria);
		}
	</script>
	
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Detalle</title>
</head>
<body>

<div id="container">

<!-- Aqui va el menu -->
<jsp:include page="menu.jsp" />
<div id="content">


<form:form method="post" action="addtbCatMateriaTempDet"
		commandName="tbCatMateriaTempDet">
					
  <div id="top">
		<h2 class="divTextoEncabezado">Materias de ${tbCatMateriaTempDet.tbCatMateriaTemp.nombreTemp}</h2>
  </div>
    <div id="leftSide">
  <fieldset>
<legend>Registro de materias </legend>
	<label for="nombreMateria">Materia:</label>
	<div class="div_texbox">
		<form:hidden path="tbCatMateriaTemp.idMateriaTemp" id="idMateriaTemp" />
		<form:hidden path="tbMateria.idMateria" id="idMateria" />
		<form:hidden path="idCatMateriaTempDet" id="idCatMateriaTempDet" />	
		<form:input readonly="true" path="tbMateria.nombreMateria" id="nombreMateria" class="required inputTextFacturaAgregar"/><input type="button" id="buscar" name="buscar" class="inputBoton botonLupa" onclick="TINY.box.show({iframe:'<%request.getContextPath();%>findMateria',boxid:'frameless',width:600,height:350,fixed:true,maskid:'bluemask',maskopacity:100})">        
	</div>
	
	
	
	
	<div class="button_div">
	<input name="Submit" type="submit" value="Ingresar" class="buttons" />
	</div>
	<div class="editbutton_div" style="display: none">
	<input name="Submit" type="submit" value="Editar" class="buttons" 
	onclick="edit('tbCatMateriaTempDet','edittbCatMateriaTempDet')"/>
	<input name="Submit" type="submit" value="Eliminar" class="buttons" 
	onclick="edit('tbCatMateriaTempDet','deletetbCatMateriaTempDet')"/>
	<input name="Submit" type="submit" value="Cancelar" class="buttons" 
	onclick="edit('tbCatMateriaTempDet','showtbCatMateriaTempDet?idColegio=${tbCatMateriaTempDet.tbCatMateriaTemp.idMateriaTemp}')"/>
	
	</div>
	
	</fieldset>
  </div>
  </form:form>
	
	<!-- Extreme Table  -->
	<ec:table items="tbCatMateriaTempList"
		action="${pageContext.request.contextPath}/showtbCatMateriaTempDet?idColegio=${tbCatMateriaTempDet.tbCatMateriaTemp.idMateriaTemp}"
		view="compact"
		imagePath="${pageContext.request.contextPath}/resources/images/compact/*.gif"
		rowsDisplayed="8" autoIncludeParameters="false" var="grado">
		
		

		<ec:row highlightRow="true" 
		onclick="onTableClick(	
								'${pageScope.grado.tbMateria.idMateria}',
								'${pageScope.grado.tbMateria.nombreMateria}',
								'${pageScope.grado.idCatMateriaTempDet}');"
			>
			<ec:column property="tbMateria.nombreMateria" title="Nombre Materia" />
			
		</ec:row>
	</ec:table>
	
	</div>



</div>
	
</body>
</html>